package com.zblx.lcd.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.zblx.lcd.MainActivity;

/**
 * @author: macy
 * @Email: 420534221@qq.com
 * @Date: 2020/8/5
 * @describe:
 */
public class BootBroadcastReceiver  extends BroadcastReceiver {

    public static final String ACTION = "android.intent.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {

        if(null!=intent.getAction()&&intent.getAction().equals(ACTION)){
            Intent myIntent = new Intent(context, MainActivity.class);
            myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(myIntent);
        }

    }

}
